# Maintainer: Pellegrino Prevete <pellegrinoprevete@gmail.com>

_realname=libhandy
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.0.10
pkgrel=1
pkgdesc="A library full of GTK+ widgets for mobile phones (mingw-w64)"
url="https://source.puri.sm/Librem5/libhandy"
license=("LGPL2.1")
arch=('any')
depends=("${MINGW_PACKAGE_PREFIX}-gtk3")
makedepends=("${MINGW_PACKAGE_PREFIX}-meson"
             "${MINGW_PACKAGE_PREFIX}-pkg-config"
             "${MINGW_PACKAGE_PREFIX}-vala"
             "${MINGW_PACKAGE_PREFIX}-gobject-introspection")
options=('strip' 'staticlibs' '!debug')
source=("https://source.puri.sm/Librem5/libhandy/-/archive/v${pkgver}/libhandy-v${pkgver}.tar.bz2")
sha256sums=('366350c0c15f53b8de4032780de4c5a5c41dfe2001d7b3d39ec6399123c2cb73')

build() {
  [[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH}
  mkdir "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH}

  ${MINGW_PREFIX}/bin/meson \
    --buildtype=plain \
    -Dexamples=false \
    -Dgtk_doc=false \
    -Dglade_catalog=disabled \
    ../"libhandy-v${pkgver}"

  ${MINGW_PREFIX}/bin/ninja
}

package() {
  cd "${srcdir}"/build-${CARCH}
  DESTDIR="${pkgdir}${MINGW_PREFIX}" ${MINGW_PREFIX}/bin/ninja install
}
